[16.0][FIX] budget_appropriation_summary: reconcile summary totals with compilation#693
Open
n3n wants to merge 3 commits into
Open
[16.0][FIX] budget_appropriation_summary: reconcile summary totals with compilation#693n3n wants to merge 3 commits into
n3n wants to merge 3 commits into
Conversation
…th compilation amount_net Summary reports on the /budget_appropriation_summary portal page did not match the master totals because every F-report (F2/F4P/F4W/F5P/F5W/F7W/ F8W/F9W/F10W/F11W) aggregated raw line balances, ignoring deduct lines and the compilation layer entirely. Refactor every summary model to iterate summary.compilation_ids and use two new helpers on budget.appropriation.compilation: - iter_signed_lines(budget_type): yields (line, sign) where deduct_line_ids contribute -1 so per-compilation sums equal amount_net. - top_level_department_id(): returns the compilation's top-level ancestor department so attribution follows the compilation, not the line. Additional fixes: - F5W/F8W/F9W: replace `prefix in parent_path` substring match with `parent_path.startswith(prefix)` to stop id "10/" colliding with "110/". - F9W: make reserve-fund and activity-plan columns mutually exclusive so 07020 lines no longer count into both columns.
…evenue reports Revenue F-reports (F2/F4P/F4W) must show gross revenue (ก่อนหักโอน). The previous commit incorrectly subtracted deduct_line_ids for revenue summaries, which represents transfers out and should not reduce the revenue figures shown in the F-reports. Iterate revenue_appropriation_ids.line_ids only on the revenue summaries. Expense summaries continue to use iter_signed_lines to net out deducts because amount_expense_total uses amount_net.
…s from revenue reports" This reverts commit 815c237.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Summary reports on
/budget_appropriation_summarydid not match master totals because every F-report (F2/F4P/F4W/F5P/F5W/F7W/F8W/F9W/F10W/F11W) aggregated raw line balances, bypassing the compilation layer and itsamount_netsemantics. All summary models now iteratesummary.compilation_idsvia two new helpers onbudget.appropriation.compilation—iter_signed_lines()(subtractsdeduct_line_ids) andtop_level_department_id()— so per-compilation sums equalamount_netand department attribution follows the compilation. Also fixes theprefix in parent_pathsubstring collision in F5W/F8W/F9W and the reserve-fund vs activity-plan double-count in F9W.Test plan
/budget_appropriation_summary/<id>/htmland verify each F-report grand total matches the masteramount_revenue_total/amount_expense_totaldeduct_line_idsand confirm summaries net out the deduction